package com.supermap.business.cloud.chinatemplate;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtil;
import com.supermap.dubbo.api.cloud.chinatemplate.ChinaTemplateService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @author aqua
 * @description
 * @date 2018年12月11 下午 7:06
 * @email 1301584033@qq.com
 */

@Controller
@RequestMapping("/cloud/china/template")
public class ChinaTemplateController {
    @Reference(timeout = 100000)
    private ChinaTemplateService chinaTemplateService;
    /**
     * 获取组织机构产品模板
     *
     * */
    @GetMapping("/getProductGrupByTemplateId")
    @ResponseBody
    public JSONUtil getProductGrupByTemplateId(Integer areaCode, Integer templateId){
        return  chinaTemplateService.getProductGrupByTemplateId(areaCode,templateId);
    }
    /**
     * 获取产品模板
     * */
    @GetMapping("/getListProductTemplate")
    @ResponseBody
    public List<Map<String,Object>> getListProductTemplate(){
        return  chinaTemplateService.getListProductTemplate();
    }

    /**
     * 获取决策服务产品
     * */
    @GetMapping("/getProductByProductId")
    @ResponseBody
    public List<Map<String,Object>> getProduct(String groupId){
        return  chinaTemplateService.getProduct(groupId);
    }
}
